8ef2babec6e6a3720034f6fd5c3433743e999d9e,thymeleaf-spring4/src/main/java/org/thymeleaf/spring4/processor/SpringSelectFieldTagProcessor.java,SpringSelectFieldTagProcessor,doProcess,#ITemplateContext#IProcessableElementTag#AttributeName#String#BindStatus#IElementTagStructureHandler#,59
Before Change
final IStandaloneElementTag hiddenMethodElementTag =
modelFactory.createStandaloneElementTag("input", true);
hiddenMethodElementTag.getAttributes().setAttribute("type", type);
hiddenMethodElementTag.getAttributes().setAttribute("name", hiddenName);
hiddenMethodElementTag.getAttributes().setAttribute("value", value);
hiddenMethodElementModel.add(hiddenMethodElementTag);
After Change
final boolean multiple = attributes.hasAttribute(this.multipleAttributeDefinition.getAttributeName());
StandardProcessorUtils.setAttribute(attributes, this.idAttributeDefinition, ID_ATTR_NAME, id); // No need to escape: this comes from an existing 'id' or from a token
StandardProcessorUtils.setAttribute(attributes, this.nameAttributeDefinition, NAME_ATTR_NAME, name); // No need to escape: this is a java-valid token
structureHandler.setLocalVariable(OPTION_IN_SELECT_ATTR_NAME, attributeName);
structureHandler.setLocalVariable(OPTION_IN_SELECT_ATTR_VALUE, attributeValue);
if (multiple && !isDisabled(tag)) {
final IModelFactory modelFactory = context.getConfiguration().getModelFactory(context.getTemplateMode());
final IModel hiddenMethodElementModel = modelFactory.createModel();
final String hiddenName = WebDataBinder.DEFAULT_FIELD_MARKER_PREFIX + name;
final String type = "hidden";
final String value =
RequestDataValueProcessorUtils.processFormFieldValue(context, hiddenName, "1", type);
final IStandaloneElementTag hiddenMethodElementTag =
modelFactory.createStandaloneElementTag("input", true);
final IElementAttributes hiddenMethodElementTagAttributes = hiddenMethodElementTag.getAttributes();
StandardProcessorUtils.setAttribute(hiddenMethodElementTagAttributes, this.typeAttributeDefinition, TYPE_ATTR_NAME, type);
StandardProcessorUtils.setAttribute(hiddenMethodElementTagAttributes, this.nameAttributeDefinition, NAME_ATTR_NAME, hiddenName);
StandardProcessorUtils.setAttribute(hiddenMethodElementTagAttributes, this.valueAttributeDefinition, VALUE_ATTR_NAME, value);
hiddenMethodElementModel.add(hiddenMethodElementTag);